home *** CD-ROM | disk | FTP | other *** search
/ Multimedia Jumpstart / Multimedia Microsoft Jumpstart Version 1.1a (Microsoft).BIN / develpmt / sdk / vfw11.win / vfwdk / drawdib.h_ / drawdib.bin
Encoding:
Text File  |  1993-11-19  |  5.9 KB  |  217 lines

  1. /**************************************************************************
  2.  
  3.     DRAWDIB.H   - routines for drawing DIBs to the screen.
  4.  
  5.     Copyright (c) 1990-1993, Microsoft Corp.  All rights reserved.
  6.  
  7.     this code handles stretching and dithering with custom code.
  8.  
  9.     the following DIB formats are supported:
  10.  
  11.         8bpp
  12.         16bpp
  13.         24bpp
  14.  
  15.     drawing to:
  16.  
  17.         16 color DC         (will dither 8bpp down)
  18.         256 (palletized) DC (will dither 16 and 24bpp down)
  19.         Full-color DC       (will just draw it!)
  20.  
  21. **************************************************************************/
  22.  
  23. #ifndef _INC_DRAWDIB
  24. #define _INC_DRAWDIB
  25.  
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29.  
  30. #ifndef VFWAPI
  31.     #define VFWAPI  FAR PASCAL
  32.     #define VFWAPIV FAR CDECL
  33. #endif
  34.  
  35. typedef HANDLE HDRAWDIB; /* hdd */
  36.  
  37. /*********************************************************************
  38.  
  39.   DrawDib Flags
  40.  
  41. **********************************************************************/
  42. #define DDF_0001            0x0001          /* */ /* Internal */
  43. #define DDF_UPDATE          0x0002          /* re-draw the last DIB */
  44. #define DDF_SAME_HDC        0x0004          /* HDC same as last call (all setup) */
  45. #define DDF_SAME_DRAW       0x0008          /* draw params are the same */
  46. #define DDF_DONTDRAW        0x0010          /* dont draw frame, just decompress */
  47. #define DDF_ANIMATE         0x0020          /* allow palette animation */
  48. #define DDF_BUFFER          0x0040          /* always buffer image */
  49. #define DDF_JUSTDRAWIT      0x0080          /* just draw it with GDI */
  50. #define DDF_FULLSCREEN      0x0100          /* use DisplayDib */
  51. #define DDF_BACKGROUNDPAL   0x0200        /* Realize palette in background */
  52. #define DDF_NOTKEYFRAME     0x0400          /* this is a partial frame update, hint */
  53. #define DDF_HURRYUP         0x0800          /* hurry up please! */
  54. #define DDF_HALFTONE        0x1000          /* always halftone */
  55. #define DDF_2000            0x2000          /* */ /* Internal */
  56.  
  57. #define DDF_PREROLL         DDF_DONTDRAW    /* Builing up a non-keyframe */
  58. #define DDF_SAME_DIB        DDF_SAME_DRAW
  59. #define DDF_SAME_SIZE       DDF_SAME_DRAW
  60.  
  61. /*********************************************************************
  62.  
  63.     DrawDib functions
  64.     
  65. *********************************************************************/
  66. /*
  67. **  DrawDibInit()
  68. **
  69. */
  70. extern BOOL VFWAPI DrawDibInit(void);
  71.  
  72. /*
  73. **  DrawDibOpen()
  74. **
  75. */
  76. extern HDRAWDIB VFWAPI DrawDibOpen(void);
  77.  
  78. /*
  79. **  DrawDibClose()
  80. **
  81. */
  82. extern BOOL VFWAPI DrawDibClose(HDRAWDIB hdd);
  83.  
  84. /*
  85. ** DrawDibGetBuffer()
  86. **
  87. */
  88. extern LPVOID VFWAPI DrawDibGetBuffer(HDRAWDIB hdd, LPBITMAPINFOHEADER lpbi, DWORD dwSize, DWORD dwFlags);
  89.  
  90. /*
  91. **  DrawDibError()
  92. */
  93. extern UINT VFWAPI DrawDibError(HDRAWDIB hdd);
  94.  
  95. /*
  96. **  DrawDibGetPalette()
  97. **
  98. **  get the palette used for drawing DIBs
  99. **
  100. */
  101. extern HPALETTE VFWAPI DrawDibGetPalette(HDRAWDIB hdd);
  102.  
  103.  
  104. /*
  105. **  DrawDibSetPalette()
  106. **
  107. **  get the palette used for drawing DIBs
  108. **
  109. */
  110. extern BOOL VFWAPI DrawDibSetPalette(HDRAWDIB hdd, HPALETTE hpal);
  111.  
  112. /*
  113. **  DrawDibChangePalette()
  114. */
  115. extern BOOL VFWAPI DrawDibChangePalette(HDRAWDIB hdd, int iStart, int iLen, LPPALETTEENTRY lppe);
  116.  
  117. /*
  118. **  DrawDibRealize()
  119. **
  120. **  realize the palette in a HDD
  121. **
  122. */
  123. extern UINT VFWAPI DrawDibRealize(HDRAWDIB hdd, HDC hdc, BOOL fBackground);
  124.  
  125. /*
  126. **  DrawDibStart()
  127. **
  128. **  start of streaming playback
  129. **
  130. */
  131. extern BOOL VFWAPI DrawDibStart(HDRAWDIB hdd, DWORD rate);
  132.  
  133. /*
  134. **  DrawDibStop()
  135. **
  136. **  start of streaming playback
  137. **
  138. */
  139. extern BOOL VFWAPI DrawDibStop(HDRAWDIB hdd);
  140.  
  141. /*
  142. **  DrawDibBegin()
  143. **
  144. **  prepare to draw
  145. **
  146. */
  147. extern BOOL VFWAPI DrawDibBegin(HDRAWDIB hdd,
  148.                                     HDC      hdc,
  149.                                     int      dxDst,
  150.                                     int      dyDst,
  151.                                     LPBITMAPINFOHEADER lpbi,
  152.                                     int      dxSrc,
  153.                                     int      dySrc,
  154.                                     UINT     wFlags);
  155. /*
  156. **  DrawDibDraw()
  157. **
  158. **  actualy draw a DIB to the screen.
  159. **
  160. */
  161. extern BOOL VFWAPI DrawDibDraw(HDRAWDIB hdd,
  162.                                    HDC      hdc,
  163.                                    int      xDst,
  164.                                    int      yDst,
  165.                                    int      dxDst,
  166.                                    int      dyDst,
  167.                                    LPBITMAPINFOHEADER lpbi,
  168.                                    LPVOID   lpBits,
  169.                                    int      xSrc,
  170.                                    int      ySrc,
  171.                                    int      dxSrc,
  172.                                    int      dySrc,
  173.                                    UINT     wFlags);
  174.  
  175. /*
  176. **  DrawDibUpdate()
  177. **
  178. **  redraw the last image (may only be valid with DDF_BUFFER)
  179. */
  180. #define DrawDibUpdate(hdd, hdc, x, y) \
  181.         DrawDibDraw(hdd, hdc, x, y, 0, 0, NULL, NULL, 0, 0, 0, 0, DDF_UPDATE)
  182.  
  183. /*
  184. **  DrawDibEnd()
  185. */
  186. extern BOOL VFWAPI DrawDibEnd(HDRAWDIB hdd);
  187.  
  188. /*
  189. **  DrawDibTime()  [for debugging purposes only]
  190. */
  191. typedef struct {
  192.     LONG    timeCount;
  193.     LONG    timeDraw;
  194.     LONG    timeDecompress;
  195.     LONG    timeDither;
  196.     LONG    timeStretch;
  197.     LONG    timeBlt;
  198.     LONG    timeSetDIBits;
  199. }   DRAWDIBTIME, FAR *LPDRAWDIBTIME;
  200.  
  201. BOOL VFWAPI DrawDibTime(HDRAWDIB hdd, LPDRAWDIBTIME lpddtime);
  202.  
  203. /* display profiling */
  204. #define PD_CAN_DRAW_DIB         0x0001      /* if you can draw at all */
  205. #define PD_CAN_STRETCHDIB       0x0002      /* basicly RC_STRETCHDIB */
  206. #define PD_STRETCHDIB_1_1_OK    0x0004      /* is it fast? */
  207. #define PD_STRETCHDIB_1_2_OK    0x0008      /* ... */
  208. #define PD_STRETCHDIB_1_N_OK    0x0010      /* ... */
  209.  
  210. DWORD VFWAPI DrawDibProfileDisplay(LPBITMAPINFOHEADER lpbi);
  211.  
  212. #ifdef __cplusplus
  213. }
  214. #endif
  215.  
  216. #endif // _INC_DRAWDIB
  217.